import React from 'react'
import { useLocation } from 'react-router-dom'
import { Descriptions } from 'antd'
import { useRecoilValue } from 'recoil'
import style from './style.module.less'
import IconSvg from '@/components/IconSvg'
import { adminEnum } from '@/store/adminEnumObject'

export default () => {
  const location = useLocation()
  const routerValue: any = location.state
  const adminEnumValues: any = useRecoilValue(adminEnum)

  return (
    <div className={style.examineBox}>
      <div className={style.center}>
        <div className={style.top}>医院管理员信息</div>
        <div className={style.bottom}>
          <div className={style.bottomCenter}>
            <Descriptions column={1} bordered={false} className={style.description}>
              <Descriptions.Item label='用户角色'>{adminEnumValues[routerValue.accountType]}</Descriptions.Item>
              <Descriptions.Item label='医院编码'>{routerValue.hospitalCode}</Descriptions.Item>
              <Descriptions.Item label='用户医院'>{routerValue.unitName}</Descriptions.Item>
              <Descriptions.Item label='医院所属地区'>{routerValue.regions}</Descriptions.Item>
              <Descriptions.Item label='区域城市'>{routerValue.regions}</Descriptions.Item>
              <Descriptions.Item label='姓名'>{routerValue.username}</Descriptions.Item>
              <Descriptions.Item label='联系电话'>{routerValue.phone}</Descriptions.Item>
              <Descriptions.Item label='固定电话'>{routerValue.telphone}</Descriptions.Item>
              <Descriptions.Item label='绑定邮箱'>{routerValue.email}</Descriptions.Item>
              <Descriptions.Item label='登录次数'>{routerValue.loginCount}</Descriptions.Item>
              <Descriptions.Item label='上一次登录时间'>{routerValue.lastLoginDate}</Descriptions.Item>
            </Descriptions>
          </div>
        </div>
        <div className={style.imageBox}>
          <IconSvg name='examineImage' style={{ width: '100%', height: '100%' }} />
        </div>
      </div>
    </div>
  )
}
